<template>
  <div class="page">
    <div class="content-wrapper fade-in-section" ref="section1">
      <!-- 左侧文字卡片1 -->
      <div class="text-card">
        <div class="card-header">
          <h2>图像/视频处理与计算机视觉</h2>
        </div>
        <div class="card-body">
          <p>
            深耕视觉基础模型，探索目标检测与跟踪中的关键问题，专注于基于深度学习的视觉信息理解，系统研究包括目标检测、目标跟踪及复杂场景下的多目标跨镜跟踪。检测类算法（RV-YOLO）可用于多种不同场景下不同目标的检测和识别，算法输出目标物体或行为的位置坐标框、类别以及置信度值。针对检测需求，研发了各类不同应用场景下的目标检测算法架构。
          </p>
        </div>
      </div>

      <!-- 右侧轮播图1 -->
      <div class="carousel-container">
        <el-carousel height="42 0px" indicator-position="outside">
          <el-carousel-item v-for="(item, index) in carouselItems1" :key="index">
            <div class="carousel-item">
              <img :src="item.image" :alt="item.title" />
            </div>
          </el-carousel-item>
        </el-carousel>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'computerVisions',
  data() {
    return {
      carouselItems1: [
        {
          image: require('@/assets/img/vision1.png'),
          // routepath: '/researchDirection/bigModel'
        },
        {
          image: require('@/assets/img/vision2.png'),
          // routepath: '/researchDirection/actionRecognition'
        },
        {
          image: require('@/assets/img/vision3.png'),
          // routepath: '/researchDirection/edgeComputer'
        },
        {
          image: require('@/assets/img/vision4.png'),
          // routepath: '/researchDirection/intelligentAgent'
        }
      ],
    }
  },

}
</script>

<style scoped>
.page {
  min-height: 60vh; /* 确保页面最小高度等于视口高度 */
  display: flex;
  flex-direction: column;
}

.content-wrapper {
  display: flex;
  gap: 30px;
  margin: 0 auto;
  max-width: 1200px;
  margin-bottom: 60px; /* 增加底部间距，让滚动效果更明显 */
}

.fade-in-section {
  margin-top: 65px;
}

.text-card {
  flex: 1;
  min-width: 300px;
}

.card-header {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 8px 8px 0 0;
  border-bottom: 1px solid #eee;
}

/* 移除 .card-body 的固定高度，改为最小高度 */
.card-body {
  /* height: 310px; */ /* 删除此句 */
  min-height: 310px; /* 保留最小高度，避免内容过短时变形 */
  background: white;
  padding: 20px;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

/* 轮播图高度改为自适应，或根据内容比例调整 */
.el-carousel {
  /* height: 400px; */ /* 删除固定高度 */
  min-height: 400px; /* 保留最小高度确保基础显示 */
}

::v-deep .el-carousel__indicator--horizontal .el-carousel__button {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin: 0 5px;
  background-color: #6a11cb; /* 自定义未选中颜色 */
  border: none; /* 清除默认边框，避免颜色干扰 */
}

/* 选中状态的指示器样式 */
::v-deep .el-carousel__indicator--horizontal.is-active .el-carousel__button {
  background-color: #970e e0; /* 选中时颜色（加深未选中色，更醒目） */
  opacity: 1;
}
::v-deep .el-carousel__arrow {
  width: 50px;
  height: 50px;
  background-color: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  border: 1px solid black;
  opacity: 0.8;
  transition: all 0.3s ease;
  font-size: 24px;
  color: black;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-container {
  flex: 2;
  min-width: 400px;
  margin-left: 20px;
  border: 1px solid #e6e6e6;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

.carousel-item {
  position: relative;
  width: 100%;
  height: 100%;
}

.carousel-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 8px;
}
</style>